﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SiteMaster : System.Web.UI.MasterPage
{
    #region ATRIBUTOS
    #endregion

    #region PROPIEDADES
    #endregion

    #region METODOS

    private void CerrarSesion()
    {
        Session.RemoveAll();
        Session.Abandon();
        Response.Clear();
        Response.Write("<script language=javascript> top.location ='/Chilis.Marketing/Login.aspx'</script>");
    }

    #endregion

    #region EVENTOS

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["objUsuario"] != null)
        {
            this.lblUsuario.Text = string.Format("Usuario {0} - {1}", Session["objUsuario"].ToString(), DateTime.Now.ToString("dd/MM/yyyy"));
        }
        else
        {
            Response.Redirect("~/Login.aspx", false);
        }
    }
    protected void lbCerrar_Click(object sender, EventArgs e)
    {
        this.CerrarSesion();
    }

    #endregion

    

    
}
